package com.sxb.spike.config;

import com.sxb.spike.pojo.User;

/**
 * @author 沈小白
 * @project spike
 * @description 通用接口限流
 * @date 2023/6/30 15:16:16
 */
public class UserContext {
    private static ThreadLocal<User> userHolder = new ThreadLocal<>();

    public static void setUser(User user) {
        userHolder.set(user);
    }

    public static User getUser() {
        return userHolder.get();
    }
}
